package com.qqtop10.manager.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.qqtop10.manager.model.PagingArgs;
import com.qqtop10.manager.model.Result;
import com.qqtop10.manager.model.User;
import com.qqtop10.manager.service.UserService;

@RequestMapping("/manager/user/")
@Controller
public class UserController extends BaseController {

	@Autowired
	@Qualifier("userService")
	private UserService userService;

	@RequestMapping("all.do")
	@ResponseBody
	public Result all(User input) {
		try {
			PagingArgs pagingArgs = getPagingArgs();
			return page(userService.count(input), userService.all(input, pagingArgs));
		} catch (Exception e) {
			return excep(e);
		}
	}
}